#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int n, X, Y;
int x, y;

vector<pair<int, int>> v;

bool cmp(pair<int, int> a, pair<int, int> b)
{
    if (a.first < b.first)
        return true;
    else if(a.first==b.first){
        if(a.second<=b.second) return true;
        else return false;
    }
    else  return false;
}

int getdis()
{
    return (x - X) * (x - X) + (y - Y) * (y - Y);
}

int main()
{
    cin >> n >> X >> Y;
    for (int i = 1; i <= n; i++)
    {
        cin >> x >> y;
        int dis = getdis();
        v.push_back(make_pair(dis, i));
    }
    sort(v.begin(), v.end(), cmp);
    cout << v[0].second << endl;
    cout << v[1].second << endl;
    cout << v[2].second << endl;
   // system("pause");
}